#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton* button = new QPushButton(this);

    //自定义信号和槽函数连接
    connect(this, &Widget::MySignal, this, &QWidget::close);
    //信号和信号绑定
    connect(button, &QPushButton::clicked, this, &Widget::MySignal);
}

Widget::~Widget()
{
    delete ui;
}

